<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>鼠标事件</title>
    <style>
      #box1{
        width: 200px;
        height: 200px;
        border: 1px red solid;
        position: relative;
        left: 50%;
      }
    </style>
     <script>
       window.onload = function () {
         let divEle = document.getElementById("box1");
         divEle.onmouseenter = function (){
           alert("鼠标移入盒子")
         }
         divEle.onmouseleave = function () {
           alert("鼠标移除盒子")
         }
        /* divEle.onmousemove = function () {
           alert("鼠标在盒子上移动")
         }*/
         /*divEle.onmousedown = function () {
           alert("鼠标在盒子里按下")
         }*/
         divEle.onmouseup = function () {
           alert("鼠标在盒子松开")
         }

       }
     </script>
</head>
<body>
  <div id="box1">
      盒子一
  </div>
</body>
</html>